﻿using System;
using System.Xml.Serialization;
using System.Xml;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace HtmlSanitizer
{
    [Serializable]
    public class Tag   
    {
        private ISanitizeStrategy strategy;
        

        #region Properties
        [XmlAttribute]
        public string TagName { get; set; }

        [XmlIgnore] 
        public ISanitizeStrategy SanitizeStrategy
        {
            get
            {
                if (strategy == null)
                    strategy = (ISanitizeStrategy)Activator.CreateInstance(Type.GetType(StrategyName));

                return strategy; 
            }
        }

        [XmlAttribute]
        public string StrategyName { get; set; }

        public List<string> Attributes { get; set; }
        #endregion
    }
}
